package com.study.entity.hx;

import com.study.entity.SysUser;
import com.study.service.api.hx.FX1Service;

import javax.persistence.Table;

/**
 * @description 测试单例, 暂时注释父类
 * @author hw
 * @date 2021/12/20 22:06:48
 */
@Table(name = "sys_user")
public class People extends SysUser implements FX1Service <Integer>{
    public String name;
    public String age;
    private String sex;
    private String idCardNo;
    public static String ADDRESS;

    private static People people;

    public People() {
        if(people != null){
            throw new RuntimeException("该实例已存在！");
        }
    }

    public People(String name) {
        this.name = name;
    }

    private People(String name, String age, String sex, String idCardNo) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.idCardNo = idCardNo;
    }

    /*@Override
    public String toString() {
        return "People{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", sex='" + sex + '\'' +
                ", idCardNo='" + idCardNo + '\'' +
                ", like='" + like + '\'' +
                '}';
    }*/

    /**
     * @description 继承的方法
     * @author hw
     * @date 2021/12/20 20:43:25
     * @param a:
     * @param b:
     */
    @Override
    public void add(Integer a, Integer b) {
        System.out.println(a + b);
    }


    /**
     * @description 方法测试
     * @author hw
     * @date 2021/12/20 20:48:09
     */
    public void jump(String jump){
        System.out.println("just jump " + jump + " ...");
    }

    /**
     * @description 方法测试
     * @author hw
     * @date 2021/12/20 21:03:41
     * @param swim:
     */
    private void swim(String swim){
        System.out.println("just swim " + swim + " ...");
    }

    /**
     * @description 方法测试
     * @author hw
     * @date 2021/12/20 21:06:09
     */
    public static void sing(String sing){
        System.out.println("just sing " + sing + " ...");
    }

    public static People getPeople(){
        if(people == null){
            people = new People();
        }
        return people;
    }
}
